<?php
   require 'dbcon.php';
   $ename=$_REQUEST['e_name'];
   $edept=$_REQUEST['e_dept'];
   $eimg=$_REQUEST['e_img'];
   $dateofbirth=$_REQUEST['date_of_birth'];
   $dateofentry=$_REQUEST['date_of_entry'];
   $sql="insert into tb_emp(e_name,e_dept,e_img,date_of_birth,date_of_entry) values('{$ename}','{$edept}','{$eimg}','{$dateofbirth}','{$dateofentry}')";
   $rs=$db->query($sql);//执行SQL语句
    if  ($rs==true)
    {
       echo "<script language='javascript' type='text/javascript'>"; 
       //echo "alert('留言成功！');";
       echo "window.location.href='index.php';";
       echo "</script>";
    }
    else {
       echo "<script language='javascript' type='text/javascript'>"; 
       echo "alert('添加员工失败！');";
       echo "window.location.href='index.php';";
       echo "</script>";
   }

